/*
编写 : Hexh
时间 : 2012-7-9 10:48:31
*/
using System;
using System.Collections.Generic;
using FsCarInfo.Core.Entity;
using FsCarInfo.Core.Entity.IRespositories;
using HMIS.FrameWork;
using HMIS.FrameWork.DomainBase;

namespace FsCarInfo.Facade.Impl
{
	/// <summary>
	///	 the impl of IFsGatelogFacade
	/// </summary>
	public class FsGatelogFacadeImpl : IFsGatelogFacade
	{

		private readonly IFsGatelogRepository FsGatelogRepository;

		public FsGatelogFacadeImpl(IFsGatelogRepository FsGatelogRepository)
        {
			this.FsGatelogRepository = FsGatelogRepository;
        }

        #region IFsGatelog Entity Save,Get,Update,Delete

		public FsGatelog Get(string id)
		{
			return FsGatelogRepository.Get(id);
		}

		public FsGatelog Load(string id)
		{
			return FsGatelogRepository.Load(id);
		}

		public FsGatelog GetCurGateLogByIdCard(string CardUid, string CarNo, string GateId)
		{
			return FsGatelogRepository.GetCurGateLogByIdCard(CardUid, CarNo, GateId);
		}

		public FsGatelog GetCurrentLogByIdCard(string CardUid)
		{
			return FsGatelogRepository.GetCurrentLogByIdCard(CardUid);
		}

		public void SaveOrUpdate(FsGatelog entity)
		{
			this.FsGatelogRepository.SaveOrUpdate(entity);
		}

		public void Delete(string id)
		{
			FsGatelogRepository.Delete(id);
		}
		
		public void PhysicsDelete(string id)
		{
			FsGatelogRepository.PhysicsDelete(id);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return FsGatelogRepository.IsFieldExist(fieldName, fieldValue, id);
		}
		
		public bool IsFieldExistWhere(string fieldName, string fieldValue, string id, string where)
		{
			return FsGatelogRepository.IsFieldExistWhere(fieldName, fieldValue, id, where);
		}
		
		#endregion
		
		#region Query 

		public IList<FsGatelog> GetAll()
		{
			return FsGatelogRepository.GetAll();
		}

		public IList<FsGatelog> GetPlist(string query, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
        {
			return FsGatelogRepository.GetPlist(query, start, limit, sort, dir, filters, out total);
        }
		
		#endregion
	}
}
